<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <% String path = request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <title>上传你做的酸辣无骨鸡爪_豆果美食</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="豆果美食 www.douguo.com">
    <meta name="google-site-verification" content="2gKQfz4b2duFoGhkAMtl9EsHRd0nJWda-SxknzWYAGA">
    <meta name="y_key" content="e4b03bf435642365">
    <meta property="wb:webmaster" content="5d3113ad6af60df9">
    <meta name="varify-v1" content="baidu-z6YB9Um9kaoKXmFf">
    <meta name="baidu-site-verification" content="nQUdpXagjA">
    <meta name="apple-itunes-app" content="app-id=434212566">
    <meta name="360-site-verification" content="081686484c9d04a6965f1bf37fa47b9f">
    <meta name="shenma-site-verification" content="f69f799dd5b5f0f6dc05e3ac55c9211b_1498788647">
    <meta name="tencent-site-verification" content="9f275b9f30d0bdcb0458994a2f19e45b">
<meta name="360_ssp_verify" content="e2ac109d04ee9e411f4f5b6073150d21">
    <link rel="icon" href="https://cp1.douguo.com/static/nweb/images/favicon.ico?v=1912" type="image/x-icon">
    <link rel="stylesheet" href="https://cp1.douguo.com/static/nweb/css/main.css?st=01078">
            <link rel="stylesheet" href="https://cp1.douguo.com/static/nweb//css/release.css?701">
        <script src="https://www.googletagservices.com/activeview/js/current/osd.js?cb=%2Fr20100101"></script><script src="https://partner.googleadservices.com/gampad/cookie.js?domain=www.douguo.com&amp;callback=_gfp_s_&amp;client=ca-pub-6608973961595981&amp;cookie=ID%3Dda0997de2d217233-221895bf73c4004f%3AT%3D1603953454%3ART%3D1603953454%3AS%3DALNI_MZIr2j7VsTiX7YVEofY0_0khCAjew"></script><script src="https://pagead2.googlesyndication.com/pagead/js/r20201029/r20190131/show_ads_impl_fy2019.js" id="google_shimpl"></script><script src="https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f"></script><script src="https://cp1.douguo.com/static/nweb/js/jquery.js?st=20190421"></script>
    <script data-ad-client="ca-pub-6608973961595981" async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" data-checked-head="true"></script>
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
<link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=www.douguo.com" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=www.douguo.com"></script>
</head>
<body>
<jsp:include page="inc/head.jsp"></jsp:include>
<script type="text/javascri pt" src="<%=path %>/static/js/jquery-3.5.1.min.js"></script>
<script>
    //var time=Date.parse(new Date());
    $.ajax({
        url: "/login/user?time="+new Date().getTime(),
        data:"",
        success:function(res) {
            var headhtml="";
            if(res.data.user.user_id){//登录
                var user=res.data.user;
                // 发布弹窗
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a>';
                if(user.is_create_article){
                    headhtml+='<a href="/uparticle.html">发布长笔记</a>';
                }
                if(user.is_create_video){
                    headhtml+='<a href="/video/upvideo">发布视频</a>';
                }
                headhtml+="  </div> </div>";
                //头像
                headhtml+='<div class="myinfo relative" onmouseover="javascript:$(\'.myedit\').show();" onmouseout="javascript:$(\'.myedit\').hide();"> <a class="headicon" href="/u/'+user.username+'.html"> <img class="wb100 br50" src="'+user.headicon+'" alt=""> <span class="msgnum"></span> </a> <div class="myedit br8"> <span class="arwwj"> </span> <a class="relative" href="/message/remind/1" target="_blank">消息提醒 <span class="boll"></span> </a> <a href="/u/'+user.username+'/collect">我的收藏</a> <a href="/draft/recipe">草稿箱</a> <a href="/user/profile" target="_blank">账号设置</a> <a href="/logout?v=1540878216">退出</a> </div> </div>';
            }else{//未登录
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a> </div> </div> <div class="perinfo"> <a class="login" href="/login"> 登录 </a> | <a class="register" href="/signup.html" target="_blank"> 注册 </a></div>';
            }
            $("#header .header").append(headhtml);
        }
    });
</script>
<%String referer =request.getHeader("Referer");
session.setAttribute("referer", referer);
%>
<div id="content" class="clearfix mh600">
    <div class="title-head mbt30 mt30">
        <h3>上传我做的作品</h3>
    </div>
    <form action="<%=path %>/HotWorksServlet?action=upWorks" class="upload-works" method="post" enctype="multipart/form-data">
    	<input type="hidden" name="cookbookId" value="<%=request.getParameter("cookbookId")%>">
        <div class="upload-box">
           <span class="add-icon"></span>
            <p>上传作品图</p>
            
            <input type="file" oninput="showImg()" id="image" name="image[]">
            <input type="hidden" name="cover">
            <input type="hidden" name="cover_width">
            <input type="hidden" name="cover_height">
        </div>
        <div class="loading">

            <span class="loading-icon"></span>
            <p>正在上传</p>
        </div>
        <div class="img-box">
            <img src="" id="show" alt="">
            
            <button class="delete" type="button" onclick="deleteImgBox()"></button>
        </div>
        <!-- <img src="" id="show" class="showIMG" width="200px;" height="200px;"> -->
        <textarea placeholder="心得体会~" name="content" id="info"></textarea>
        <input id="file" class="filepathFood" name="foodPIC" onchange="changepic(this)" type="file"><br>
        <br><br><h2>标题：</h2>
<input type="text" id="title" name="title" style="border:1px solid #E5E3DF;height:35px;" size="30">
        
        <div class="signupcode mt30">
           <input type="hidden" name="check" value="1">
            <span>验证码：</span>
            <input style="display: inline-block;width:200px;height: 40px;line-height: 40px;border: 1px solid #E5E3DF;padding: 0 12px;border-radius: 4px;font-size: 15px;" type="text" name="signupcode" id="signupcode">
             <img src="<%=path%>/CodeServlet?action=code" onclick="refreshcode()" class="codeImg" style="cursor: pointer;">
        </div>
        <a href="javascript:void(0)" class="release" onclick="tijiao()">发布</a>
        <span id="tips" style="color:red"></span>
    </form>
</div>
<script>
$(function(){
/* function changepic(i) {
alert(i);
        var reads= new FileReader();
         f=document.getElementById('file'+i).files[0]; 
        reads.readAsDataURL(f);
        reads.onload=function (e) {
            document.getElementById('show'+i).src=this.result;
        };
} */
  function changepic() {
        var reads= new FileReader();
        f=document.getElementById('file').files[0];
        reads.readAsDataURL(f);
        reads.onload=function (e) {
            document.getElementById('show').src=this.result;
        };
       /*  $(".img-box").show() */
    }
$(".release").click(function(){
if($("#file").val()==""){
$("#tips").html("请添加图片");
return;
}
if($("#info").val()==""){
$("#tips").html("请添加简介");
return;
}
if($("#title").val()==""){
$("#tips").html("请添加标题");
return;
}
var signupcode = $("#signupcode").val();
if($("#signupcode").val()==""){
$("#tips").html("请输入验证码");
return;
}
$.ajax({
url:"<%=path%>/CodeServlet",
data:{action:"check",code:signupcode},
async:false,
success:function(mes){
if("no"==mes){
$("#tips").html("验证码不正确");
$("#signupcode").select();
}
else{
$("#tips").html("");
$(".upload-works").submit();
}
}
});
/* $(".upload-works").submit(); */
});
});
    function refreshcode() {
    	<%-- $(".codeImg").attr("src","<%=path%>/CodeServlet?action=code&rand="+Math.random()); --%>
        $(".codeImg").attr("src", "<%=path%>/CodeServlet?action=code&rand=" + (new Date()).getTime());
    }
 /*    function tijiao() {
        var code = $('#signupcode').val();
        if(!code){
            tip({text:'请填写验证码'});
            return;
        }
        var data = {
            'cook_id':'3007477',
            'import_type':2,
            'cover':$('input[name="cover"]').val(),
            'cover_width':$('input[name="cover_width"]').val(),
            'cover_height':$("input[name='cover_height']").val(),
            'content':$("textarea[name='content']").val(),
            '_token':'UBZ2NiBtXOCJo9MGGawDMVwAGmE9A9AxUkZfNy97',
            'code':code
        }
        $.ajax({
            url:'/note/create/',
            data:data,
            type:'post',
            success:function (res) {
                if(res.errcode == 0){
                    var note_id = res.data.note_id;
                    window.location.href='/ncdish/'+note_id
                }
                tip({text:res.msg});
            }
        })
    } */
/*     function showImg() {
        loading();
        $.ajaxFileUpload(
            {
                url: '/upload/image',
                data: {type: 4,'size':'320', '_token':"UBZ2NiBtXOCJo9MGGawDMVwAGmE9A9AxUkZfNy97"},
                secureuri: false,
                fileElementId: 'image',
                dataType: 'json',
                success: function (res) {
                    if(res.errcode=="10000"){
                        tip({text: "请更换图片后重试！"})
                    }
                    var image = res.data.success[0];
                    loaded();
                    $(".img-box img").attr("src", image.image_url);
                    $(".img-box").show()
                    $('input[name="cover"]').val(image.actual_url)
                    $('input[name="cover_width"]').val(image.width)
                    $('input[name="cover"]').val(image.actual_url)
                    $('input[name="cover_height"]').val(image.height)
                }
            });
    } */
/*     //显示加载中
    function loading() {
        $(".loading").show()
    }

    //加载完成隐藏
    function loaded() {
        $(".loading").hide()
    }
    // 重新选择图片
    function deleteImgBox() {
        $("input[name='img-url']").val("");
        $(".img-box").hide();
        $(".upload-box input").val("")
    } */
</script>
<div id="footer">
    <jsp:include page="/inc/foot.jsp"></jsp:include>
</div>
            <script src="https://cp1.douguo.com/static/nweb//js/ajaxfileupload.js?4"></script>
            <script src="https://cp1.douguo.com/static/nweb//js/tip.js"></script>
    <script src="https://cp1.douguo.com/static/nweb/js/tip.js?v=2019"></script>
<script src="https://cp1.douguo.com/static/nweb/js/search.js?v=12171145"></script>
<script src="https://cp1.douguo.com/static/nweb/js/main.js?v=201911"></script>
<!-- <script src='https://s13.cnzz.com/c.php?id=30029854' language='JavaScript' charset='gb2312'></script> -->

<ins class="adsbygoogle adsbygoogle-noablate" data-adsbygoogle-status="done" style="display: none !important;"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><iframe id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;border:0;width:undefinedpx;height:undefinedpx;" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" frameborder="0" src="https://googleads.g.doubleclick.net/pagead/ads?guci=2.2.0.0.2.2.0.0&amp;client=ca-pub-6608973961595981&amp;output=html&amp;adk=1812271804&amp;adf=3025194257&amp;lmt=1604307223&amp;plat=1%3A32776%2C2%3A16809992%2C9%3A32776%2C10%3A32%2C11%3A32%2C16%3A8388608%2C17%3A32%2C24%3A32%2C25%3A32%2C30%3A1081344%2C32%3A32%2C40%3A32&amp;format=0x0&amp;url=https%3A%2F%2Fwww.douguo.com%2Fcookbook%2F3007477%2Fcreate_dish&amp;ea=0&amp;flash=0&amp;pra=5&amp;wgl=1&amp;tt_state=W3siaXNzdWVyT3JpZ2luIjoiaHR0cHM6Ly9hZHNlcnZpY2UuZ29vZ2xlLmNvbSIsInN0YXRlIjowfSx7Imlzc3Vlck9yaWdpbiI6Imh0dHBzOi8vYXR0ZXN0YXRpb24uYW5kcm9pZC5jb20iLCJzdGF0ZSI6MH1d&amp;dt=1604307223043&amp;bpp=4&amp;bdt=57&amp;idt=17&amp;shv=r20201029&amp;cbv=r20190131&amp;ptt=9&amp;saldr=aa&amp;abxe=1&amp;cookie=ID%3Dda0997de2d217233-221895bf73c4004f%3AT%3D1603953454%3ART%3D1603953454%3AS%3DALNI_MZIr2j7VsTiX7YVEofY0_0khCAjew&amp;nras=1&amp;correlator=5527234976234&amp;frm=20&amp;pv=2&amp;ga_vid=55106075.1603953456&amp;ga_sid=1604307223&amp;ga_hid=2133677318&amp;ga_fc=1&amp;iag=0&amp;icsg=600064&amp;dssz=15&amp;mdo=0&amp;mso=8&amp;u_tz=480&amp;u_his=2&amp;u_java=0&amp;u_h=1080&amp;u_w=1920&amp;u_ah=1040&amp;u_aw=1920&amp;u_cd=24&amp;u_nplug=3&amp;u_nmime=4&amp;adx=-12245933&amp;ady=-12245933&amp;biw=1903&amp;bih=969&amp;scr_x=0&amp;scr_y=0&amp;eid=21068084%2C44729242&amp;oid=3&amp;pvsid=2848885803741525&amp;pem=360&amp;ref=https%3A%2F%2Fwww.douguo.com%2Fcookbook%2F3007477.html&amp;rx=0&amp;eae=2&amp;fc=1920&amp;brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1040%2C1920%2C969&amp;vis=1&amp;rsz=%7C%7Cs%7C&amp;abl=NS&amp;fu=8200&amp;bc=31&amp;ifi=0&amp;uci=a!0&amp;fsb=1&amp;dtd=36" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" data-google-container-id="a!0" data-load-complete="true"></iframe></ins></ins></ins><iframe id="google_osd_static_frame_2371465229979" name="google_osd_static_frame" style="display: none; width: 0px; height: 0px;"></iframe>
</body>
<iframe id="google_esf" name="google_esf" src="https://googleads.g.doubleclick.net/pagead/html/r20201029/r20190131/zrt_lookup.html#" data-ad-client="ca-pub-6608973961595981" style="display: none;">
</iframe>
</html>